home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  5.6 KB  |  210 lines  |  [TEXT/MPS ]

  1. ; Version: 1.20
  2. ; Created: Sunday, October 15, 1989
  3. ;
  4. ; File: Processes.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1989-1991
  8. ; All Rights Reserved
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__IncludingProcesses__') = 'UNDEFINED' THEN
  12. __IncludingProcesses__    SET    1
  13.  
  14.     IF &TYPE('__IncludingTraps__') = 'UNDEFINED' THEN   ; for _Launch, _OSDispatch
  15.     INCLUDE 'Traps.a'
  16.     ENDIF
  17.  
  18. ;__________________________________________________________________________________
  19. ; Process Serial Number (PSN)
  20. ;__________________________________________________________________________________
  21. ; various reserved process serial numbers
  22. kNoProcess        EQU         0                         ; no process at all
  23. kSystemProcess    EQU         1                         ; the system
  24. kCurrentProcess   EQU         2                         ; the switched-in process
  25.  
  26. ; record definition
  27. ProcessSerialNumber    RECORD    0
  28. highLongOfPSN        DS.L    1            ; the upper half
  29. lowLongOfPSN        DS.L    1            ; the lower half
  30. size                EQU        *
  31.                     ENDR
  32.  
  33. ; record definition (old style definition)
  34. highLongOfPSN        EQU        0
  35. lowLongOfPSN        EQU        4
  36.  
  37. ;__________________________________________________________________________________
  38. ; parameter block passed in the _Launch trap.
  39. ;__________________________________________________________________________________
  40.  
  41. ; flags for launchControlFlags field
  42. launchContinue    EQU         $4000
  43. launchNoFileFlags EQU         $0800
  44. launchUseMinimum  EQU         $0400
  45. launchDontSwitch  EQU         $0200
  46. launchAllow24Bit  EQU         $0100
  47. launchInhibitDaemon EQU       $0080
  48.  
  49. ; format of buffer pointed to by launchAppParameters
  50. AppParameters            RECORD    0
  51. theMsgEvent                DS.B    $10            ; (evtBlkSize) a HighLevelEvent record
  52. eventRefCon                DS.L    1            ; refcon for the high-level event
  53. messageLength            DS.L    1            ; number of bytes in messageBuffer
  54. messageBuffer            EQU        *            ; start of message for the high level event
  55. size                    EQU        *
  56.                         ENDR
  57.  
  58. ; format of buffer pointed to by launchAppParameters (old style definition)
  59. theMsgEvent                EQU        0
  60. eventRefCon                EQU        16
  61. messageLength            EQU        20
  62. messageBuffer            EQU        24
  63.  
  64. ; parameter block itself
  65. LaunchParamBlockRec        RECORD    0
  66. reserved1                DS.L    1
  67. reserved2                DS.W    1
  68. launchBlockID            DS.W    1    ;    { = extendedBlock }
  69. launchEPBLength            DS.L    1    ;    { = extendedBlockLen }
  70. launchFileFlags            DS.W    1
  71. launchControlFlags        DS.W    1
  72. launchAppSpec            DS.L    1
  73. launchProcessSN            DS        ProcessSerialNumber
  74. launchPreferredSize        DS.L    1
  75. launchMinimumSize        DS.L    1
  76. launchAvailableSize        DS.L    1
  77. launchAppParameters        DS.L    1
  78. size                    EQU        *
  79. extendedBlockLen        EQU        size-launchFileFlags
  80.                         ENDR
  81.  
  82. ; parameter block itself (old style definition)
  83. launchBlockID     EQU         6
  84. launchEPBLength                EQU        8
  85. launchFileFlags   EQU         12
  86. launchControlFlags EQU        14
  87. launchAppSpec                EQU        16
  88. launchProcessSN                EQU        20
  89. launchPreferredSize            EQU        28
  90. launchMinimumSize            EQU        32
  91. launchAvailableSize            EQU        36
  92. launchAppParameters            EQU        40
  93. SIZEOF_LAUNCHPARAMBLOCKREC    EQU        44
  94. extendedBlockLen            EQU        SIZEOF_LAUNCHPARAMBLOCKREC - launchFileFlags
  95.  
  96. ; set launchBlockID to extendedBlock to specify that extensions exist
  97. ; set launchEPBLength to extendedBlockLen for compatibility
  98. extendedBlock                EQU        19523
  99.  
  100. ;__________________________________________________________________________________
  101. ; Definition of the information block returned by _GetProcessInformation.
  102. ;__________________________________________________________________________________
  103.  
  104. ; bits in the processMode field
  105. modeDeskAccessory EQU         $00020000
  106. modeMultiLaunch   EQU         $00010000
  107. modeNeedSuspendResume    EQU            $00004000
  108. modeCanBackground        EQU            $00001000
  109. modeDoesActivateOnFGSwitch    EQU            $00000800
  110. modeOnlyBackground        EQU            $00000400
  111. modeGetFrontClicks        EQU            $00000200
  112. modeGetAppDiedMsg        EQU            $00000100
  113. mode32BitCompatible        EQU            $00000080
  114. modeHighLevelEventAware        EQU            $00000040
  115. modeLocalAndRemoteHLEvents    EQU            $00000020
  116. modeStationeryAware            EQU            $00000010
  117. modeUseTextEditServices        EQU            $00000008
  118.  
  119. ; record returned by GetProcessInformation
  120. ProcessInfoRec        RECORD    0
  121. processInfoLength    DS.L    1
  122. processName            DS.L    1
  123. processNumber        DS        ProcessSerialNumber
  124. processType            DS.L    1
  125. processSignature    DS.L    1
  126. processMode            DS.L    1
  127. processLocation        DS.L    1
  128. processSize            DS.L    1
  129. processFreeMem        DS.L    1
  130. processLauncher        DS        ProcessSerialNumber
  131. processLaunchDate    DS.L    1
  132. processActiveTime    DS.L    1
  133. processAppSpec        DS.L    1
  134. size                EQU        *
  135.                     ENDR
  136.                     
  137. ; record returned by GetProcessInformation (old style definition)
  138. processInfoLength EQU         0
  139. processName       EQU         4
  140. processNumber     EQU         8
  141. processType       EQU         16
  142. processSignature  EQU         20
  143. processMode       EQU         24
  144. processLocation   EQU         28
  145. processSize       EQU         32
  146. processFreeMem    EQU         36
  147. processLauncher   EQU         40
  148. processLaunchDate EQU         48
  149. processActiveTime EQU         52
  150. processAppSpec      EQU        56
  151.  
  152. ;__________________________________________________________________________________
  153. ; trap macros
  154. ;__________________________________________________________________________________
  155.  
  156.                   MACRO
  157.                   _LaunchApplication
  158.                   _Launch
  159.                   ENDM
  160.  
  161.                   MACRO
  162.                   _LaunchDeskAccessory
  163.                   MOVE.W      #$36,-(SP)
  164.                   _OSDispatch
  165.                   ENDM
  166.  
  167.                   MACRO
  168.                   _GetCurrentProcess
  169.                   MOVE.W      #$37,-(SP)
  170.                   _OSDispatch
  171.                   ENDM
  172.  
  173.                   MACRO
  174.                   _GetFrontProcess
  175.     PEA            $FFFFFFFF
  176.     MOVE.W        #$39,-(SP)
  177.     _OSDispatch
  178.                   ENDM
  179.  
  180.                   MACRO
  181.                   _GetNextProcess
  182.                   MOVE.W      #$38,-(SP)
  183.                   _OSDispatch
  184.                   ENDM
  185.  
  186.                   MACRO
  187.                   _GetProcessInformation
  188.                   MOVE.W      #$3A,-(SP)
  189.                   _OSDispatch
  190.                   ENDM
  191.  
  192.                   MACRO
  193.                   _SetFrontProcess
  194.                   MOVE.W      #$3B,-(SP)
  195.                   _OSDispatch
  196.                   ENDM
  197.  
  198.                   MACRO
  199.                   _WakeUpProcess
  200.                   MOVE.W      #$3C,-(SP)
  201.                   _OSDispatch
  202.                   ENDM
  203.  
  204.                   MACRO
  205.                   _SameProcess
  206.                   MOVE.W      #$3D,-(SP)
  207.                   _OSDispatch
  208.                   ENDM
  209.  
  210.     ENDIF    ; ...already included